<?php

namespace Biz\model\springHomeDecActivity;

use Biz\model\advertisement\MBaseDbModel;
use Biz\pockets\modelTrait\BizModelTrait;

/**
 * @property mixed|null $v
 * @property mixed|null $id
 */
class Wish extends MBaseDbModel
{
    const _CONFIG_FILE_ = 'db_store';
    
    const _CONFIG_SELECT_ = 'db_brand_activity';
    
    const _DATABASE_ = 'brand_activity';
    
    const _TABLE_NAME = 'spring_home_dec_wish';

    const LOTTERY_REMIND_YES = 1; //开启抽奖提醒
    const LOTTERY_REMIND_NO = 0;  //关闭抽奖提醒

    //删除字段名称
    protected static $deleteField = 'data_status';
    
    
    use BizModelTrait;

    public static function getV($uid)
    {
        return self::dataSelectInfo(['uid' => $uid], ['v']);
    }

    public static function increaseBrick($uid, $v, $brick)
    {
        return self::dataUpdate(['brick_count[+]' => $brick, 'update_time' => date("Y-m-d H:i:s"), 'v[+]' => 1], ['uid' => $uid, 'v' => $v], true);
    }

    public static function getInfo($uid)
    {
        $where = [
            'uid' => $uid,
            'data_status' => self::STATUS_NORMAL,
        ];
        return self::dataSelectInfo($where);
    }
}
